<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" close="true">
        <span aria-hidden="true">×</span>
    </button>
    <h4 class="modal-title">
        <span class="fa fa-user-plus"></span>&nbsp;修改角色
    </h4>
</div>
<div class="modal-body">
    <form class="form-horizontal">
        <input type="hidden" name="token" value="{$token}">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="form-group">
            <label class="col-sm-3 control-label">*角色名称:</label>
            <div class="col-sm-4">
                <input class="form-control" name="name" placeholder="角色名称" value="{$data.name}">
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*权限列表:</label>
            <div class="col-sm-8">
                <select name="privilege_list[]" class="selectpicker" multiple>
                    <?php foreach($treeArr as $treek=>$treev):
                    if(empty($treev["level"])){
                    $flag=$treev["name"];
                    }
                    ?>
                    <option value="{$treev.id}" _parent_id="{$treev.parent_id}" _level="{$treev.level}"
                            _flag="{$flag}"><?=str_repeat(".....",$treev["level"]);?>{$treev.name}
                    </option>
                    <?php endforeach;?>
                </select>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default btn-sm" close="true">关闭</button>
    <button type="button" class="btn btn-primary btn-sm" _event="edit">保存</button>
</div>
<script>
    indexinfo.privilege_arr = [{$data.privilege_list}];
    $('.selectpicker').selectpicker('val', indexinfo.privilege_arr);
    $('.selectpicker').on('changed.bs.select', privilegeTree);
</script>